const path =require('path')
//本地地址
const filepath = 'E:/dddd/ccc/index.html?id=123&name=iop'
//获得路劲中文index.html

const search = filepath.split('?').pop();

var obj = {}
var str = search.substr(1)
var arr = str.split('&')
for (var i = 0; i < arr.length; i++) {
    var newArr = arr[i].split('=')
    obj[newArr[0]] = newArr[1]
}
console.log(obj);